Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented Feb 19, 2025

TL;DR

Added safeguards and tracking for committed block numbers in the Committer component.

What changed?

  • Added lastCommittedBlock field to track the highest block number committed in memory
  • Renamed pollFromBlock to commitFromBlock for clarity
  • Added validation to prevent processing when max block number from storage is less than last committed block
  • Updated block number metrics to use the highest block number from the committed batch
  • Added comprehensive test cases for various block number scenarios

Why make this change?

To prevent potential data inconsistencies and improve block tracking accuracy. This change ensures the committer maintains a reliable record of processed blocks and handles edge cases where storage and memory states might differ.

Copy link
Contributor Author

iuwqyir commented Feb 19, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir changed the title keep track of last committed block in memory Track last committed block in memory Feb 19, 2025
@iuwqyir iuwqyir marked this pull request as ready for review February 19, 2025 13:43
Copy link
Contributor

@catalyst17 catalyst17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@iuwqyir iuwqyir merged commit c028d57 into main Feb 19, 2025
5 checks passed
@iuwqyir iuwqyir deleted the 02-19-keep_track_of_last_committed_block_in_memory branch February 19, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants